13. Your Virtual Machine
Your Virtual Machine
To follow along with the exercises in these lessons, you will need to be running Ubuntu Linux with ROS installed. So that everyone can follow along in the same environment we are providing you with a virtual machine (VM) that is all setup with everything you need. The only problem is that it's a rather large download (4+GB!). So, find yourself a good internet connection and download the compressed VM disk image .
It is good idea to keep a backup of this VM image to avoid downloading again if you need it. But just in case you do not do that there is a backup snapshot built into the VM that will allow you to restore it to its original state at anytime!
To extract the compressed image in Windows:
- Download the appropriate version of 7-zip from here
- Right-click and select "7-zip" > "Extract Here"
To extract at the command line in macOS or Linux:
- Open Terminal and navigate to directory containing the compressed image
-
execute
$ unzip Udacity_VM_Base_V1.0.0.zip
In the zipped archive in addition to the VM disk image, there are two other small configuration files that you may or may not need.
We recommend using VirtualBox to run the VM. This will enable you to easily use port forwarding, so you can run the final project simulator in your native operating system (the host) while using the VM for running ROS code.
Whichever operating system you're on, download and install the appropriate platform package for your operating system (the host) and then follow the instructions below:
Import your VM image to VirtualBox
- Download and install VirtualBox.
- Download the image from supplied link.
- Unzip the image.
- Open VirtualBox Application.
- Click File > Import Appliance..
- Click the folder icon on the right and navigate to your unzipped image (the .ovf file).
- Follow the prompts to import the image.
- From the VirtualBox Manager, select your VM and press start.
Before getting your VM up and running, you will need to make sure that you allocate enough resources to allow it to operate efficiently. With your VM shut down, navigate to the VM settings by clicking on the icon in the VirtualBox Manager. In the "System" cateogory Look for tabs labeled "Motherboard" and "Processor"; this is where you will change the amount of RAM and number of cores that you allocate from your own machine to the VM. If you have the resources on your machine, we recommend allocating at least 2 processor cores and 4 GB of RAM. If you are able to allocate more resources, feel free to do so. The more you allocate the better performance you will get! You're now all set to boot up your VM!
Upon your first boot you will be prompted to choose a keyboard layout of your choice. Once you select a keyboard you will not be prompted for this again. If you would like to change your option you can reset this feature by entering
udacity_reset
in a terminal of your choice and restarting the VM.
Once you are up and running, you might be asked to input a password to enter the VM.
The password for the VM is
udacity-nd
To open a terminal in your VM press
ctrl-Alt-t
(or
ctrl-option-t
on a Mac). You should get a terminal window that looks like this:
You're now ready to follow along in your VM with the the ROS essentials examples!
Troubleshooting Tips
-
Keyboard Mappings: Use of certain keyboards can create issues unless the corresponding keyboard has been set in the VM. This is due to keyboard mappings. A frequent issue is special characters in passwords not being entered correctly when logging in. An example useage for VirtualBox is setting up an Italian keyboard. To do this, execute the following in a terminal
localectl set-keymap it; localectl set-x11-keymap it
. -
roscore ip: If the host network interface has multiple addresses (ex: ipv6 enabled)
roscore
will fail sincehostname -I
returns multiple ip, resulting into a invalid URL. One solution to this is to replace this line in.bashrc
,export ROS_IP=`echo $( hostname -I)'
, with thisexport ROS_IP=$( hostname -I | awk '{print $1}')
.
Performing a Native Install of Linux and ROS (Unsupported)
Some of you may choose not to use the virtual machine for a variety of reasons. If you choose to install ROS (Robot Operating System) on your own, it is recommended that you use Ubuntu 16.04 LTS as your operating system. To install ROS, please visit: ROS documentation
This method is not supported by Udacity. If you have trouble performing a native install of ROS, please visit ROS answers or you can try troubleshooting your install with your fellow students in the Student Hub, or post to Knowledge .